package com.lancoo.cvas.arrangecourse.entities;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

import java.util.LinkedList;

/**
 * @Description 拆班课程
 * @Author Fortysun
 * @Date 2023/9/15 16:07
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SplitCourse {
    @NonNull
    private String courseTeacherIds;
    @NonNull
    //奇数教学班
    private LinkedList<TeachingClassUnit> oddClassList;
    @NonNull
    //偶数教学班
    private LinkedList<TeachingClassUnit> evenClassList;

    //获取教学班列表的元素数量，两个列表的元素数之和
    public Integer getSize() {
        return oddClassList.size()+evenClassList.size();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        if (getClass() != obj.getClass()) {
            return false;
        }

        boolean bRet = false;
        SplitCourse course = (SplitCourse) obj;
        if (this.courseTeacherIds.equals(course.getCourseTeacherIds())) {
            bRet = true;
        }

        return bRet;
    }
}
